package cn.tedu.demo.beans;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component//组件，spring在启动时，会自动寻找@Component注解，找到后会自动调用构造器创建对象
public class Axe {
    private String name;

    public Axe() {
        name = "斧子";
        System.out.println("创建斧子对象");
    }

    @Override
    public String toString() {
        return name;
    }
}
